/*
 * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <gtest/gtest.h>
#include "sle_error_code.h"
#include "mock_ipcobject_stub.h"
#include "sle_ssap_client_callback_proxy.h"


class SleSsapClientCallbackProxyTest : public testing::Test {
public:
    static void SetUpTestCase();
    static void TearDownTestCase();
    void SetUp() override;
    void TearDown() override;

};
void SleSsapClientCallbackProxyTest::SetUp()
{
}

void SleSsapClientCallbackProxyTest::TearDown()
{
}

void SleSsapClientCallbackProxyTest::SetUpTestCase()
{
}

void SleSsapClientCallbackProxyTest::TearDownTestCase()
{
}

namespace OHOS {
namespace NearLink {
namespace SleStandard {




HWTEST_F(SleSsapClientCallbackProxyTest, OnFindService_001, testing::ext::TestSize.Level0)
{
    sptr<IRemoteObject> mockStub = new MockIPCObjectStub(u"test");
    std::shared_ptr<SleSsapClientCallbackProxy> proxy = std::make_shared<SleSsapClientCallbackProxy>(mockStub);

    uint8_t clientId = 1;
    uint16_t connectId = 1;
    SsapClientFindServiceRes result;
    uint32_t errCode = 1;
    proxy->OnFindService(clientId, connectId, result, errCode);

}
/******************************************************************************************************************************** */

HWTEST_F(SleSsapClientCallbackProxyTest, OnFindProperty_001, testing::ext::TestSize.Level0)
{
    sptr<IRemoteObject> mockStub = new MockIPCObjectStub(u"test");
    std::shared_ptr<SleSsapClientCallbackProxy> proxy = std::make_shared<SleSsapClientCallbackProxy>(mockStub);
    uint8_t clientId = 1;
    uint16_t connectId = 1;
    SsapClientFindPropertyRes result;
    uint32_t errCode = 1;
    proxy->OnFindProperty(clientId, connectId, result, errCode);
}
/******************************************************************************************************************************** */


HWTEST_F(SleSsapClientCallbackProxyTest, OnFindComplete_001, testing::ext::TestSize.Level0)
{
    sptr<IRemoteObject> mockStub = new MockIPCObjectStub(u"test");
    std::shared_ptr<SleSsapClientCallbackProxy> proxy = std::make_shared<SleSsapClientCallbackProxy>(mockStub);
    uint8_t clientId = 1;
    uint16_t connectId = 2;
    uint8_t type = 3;
    Uuid uuid;
    uint32_t errCode = 0;
    proxy->OnFindComplete(clientId, connectId, type, uuid, errCode);
}
/******************************************************************************************************************************** */


HWTEST_F(SleSsapClientCallbackProxyTest, OnWriteResult_001, testing::ext::TestSize.Level0)
{
    sptr<IRemoteObject> mockStub = new MockIPCObjectStub(u"test");
    std::shared_ptr<SleSsapClientCallbackProxy> proxy = std::make_shared<SleSsapClientCallbackProxy>(mockStub);

    uint8_t clientId = 1;
    uint16_t connectId = 2;
    uint16_t handle = 3;
    uint8_t type = 4;
    uint32_t errCode = 0;
    proxy->OnWriteResult(clientId, connectId, handle, type, errCode);
}
/******************************************************************************************************************************** */

HWTEST_F(SleSsapClientCallbackProxyTest, OnReadResult_001, testing::ext::TestSize.Level0)
{
    sptr<IRemoteObject> mockStub = new MockIPCObjectStub(u"test");
    std::shared_ptr<SleSsapClientCallbackProxy> proxy = std::make_shared<SleSsapClientCallbackProxy>(mockStub);

    uint8_t clientId = 1;
    uint16_t connectId = 1;
    SsapClientHandleValue value;
    uint32_t errCode = 1;

    proxy->OnReadResult(clientId, connectId, value,errCode);
}
/******************************************************************************************************************************** */


HWTEST_F(SleSsapClientCallbackProxyTest, OnReadByUuidComplete_001, testing::ext::TestSize.Level0)
{
    sptr<IRemoteObject> mockStub = new MockIPCObjectStub(u"test");
    std::shared_ptr<SleSsapClientCallbackProxy> proxy = std::make_shared<SleSsapClientCallbackProxy>(mockStub);

    uint8_t clientId = 1;
    uint16_t connectId = 1;
    uint8_t type = 1;
    Uuid uuid;
    uint32_t errCode = 1;

    proxy->OnReadByUuidComplete(clientId, connectId, type,uuid,errCode);
}
/******************************************************************************************************************************** */

HWTEST_F(SleSsapClientCallbackProxyTest, OnExchangeInfo_001, testing::ext::TestSize.Level0)
{
    sptr<IRemoteObject> mockStub = new MockIPCObjectStub(u"test");
    std::shared_ptr<SleSsapClientCallbackProxy> proxy = std::make_shared<SleSsapClientCallbackProxy>(mockStub);

    uint8_t clientId =1;
    uint16_t connectId = 1;
    uint32_t mtu = 1;
    uint16_t version = 1;
    uint32_t errCode = 1;

    proxy->OnExchangeInfo(clientId, connectId, mtu,version,errCode);
}
/******************************************************************************************************************************** */

HWTEST_F(SleSsapClientCallbackProxyTest, OnNotification_001, testing::ext::TestSize.Level0)
{
    sptr<IRemoteObject> mockStub = new MockIPCObjectStub(u"test");
    std::shared_ptr<SleSsapClientCallbackProxy> proxy = std::make_shared<SleSsapClientCallbackProxy>(mockStub);

    uint8_t clientId = 1;
    uint16_t connectId = 1;
    SsapClientHandleValue value;
    uint32_t errCode = 0;

    proxy->OnNotification(clientId, connectId,value,errCode);
}
/******************************************************************************************************************************** */

HWTEST_F(SleSsapClientCallbackProxyTest, OnIndication_001, testing::ext::TestSize.Level0)
{
    sptr<IRemoteObject> mockStub = new MockIPCObjectStub(u"test");
    std::shared_ptr<SleSsapClientCallbackProxy> proxy = std::make_shared<SleSsapClientCallbackProxy>(mockStub);

    uint8_t clientId = 1;
    uint16_t connectId = 1;
    SsapClientHandleValue value;
    uint32_t errCode = 0;

    proxy->OnIndication(clientId, connectId,value,errCode);
}
/******************************************************************************************************************************** */


}}}